Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

[WIP] Support purge:orphaned for postgresql #376

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ZeroPointEnergy
Copy link
Collaborator

@ZeroPointEnergy ZeroPointEnergy commented Sep 11, 2018

This is the purge:orphaned part of the PR #333 . I did not test this so far. The reason for this PR is to separate the code out of #333 so we can review, test and discuss it better.

THIS WORK IN PROGRESS!
This PR is not tested and should not be merged currently.

DELETION_BATCH_SIZE = 1000
while deletion_count > 0
ActiveRecord::Base.connection.execute(
"DELETE FROM #{model.table_name} USING #{model.table_name} WHERE #{deletion_where_clause}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like this removes the batch part of the delete

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah postgresql doesn't support that! yikes!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants